package com.getan.boot.module.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.getan.boot.common.annotation.Dict;
import com.getan.boot.jdbc.entity.LogicEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.util.List;

/**
 * 部门
 *
 * @author Bruce.Gong
 * @since 1.0.0-SNAPSHOT
 */
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("t_sys_dept")
public class DeptEntity extends LogicEntity {

    @TableId
    private Long id;
    private Long pid;
    @Dict(value = "sys_dept_type", desc = "1子公司2部门3个人")
    private Integer type;
    private String name;
    private Integer sort;
    private String leader;
    private String phone;
    private String email;
    @Dict("common_enable_status")
    private Integer status;
    @TableField(exist = false)
    private List<DeptEntity> children;

}
